package cn.zwx.activiti.example.service;

import cn.zwx.activiti.example.model.req.DeleteDefinitionReq;
import cn.zwx.activiti.example.model.req.ProcessDefinitionsForListReq;
import cn.zwx.activiti.example.model.req.ProcessDeploymentForListReq;
import cn.zwx.activiti.example.model.resp.ProcessDefinitionsForListResp;
import cn.zwx.activiti.example.model.resp.ProcessDeploymentForListResp;
import org.activiti.api.runtime.shared.query.Page;
import org.activiti.engine.repository.Deployment;
import org.springframework.web.multipart.MultipartFile;

import java.io.InputStream;

/**
 * @description:
 * @projectName:activiti-example
 * @see:cn.zwx.activiti.example.service
 * @author:zhangwenxue
 * @createTime:2021/5/29 17:36
 * @version:1.0
 */
public interface ProcessDefinitionsService {
    /**
     * @description 查询可用的流程定义
     * @return org.activiti.api.runtime.shared.query.Page<cn.zwx.activiti.example.model.resp.ProcessDefinitionsForListResp>
     * @author zhangwenxue
     * @createTime 2021/5/29 17:53
     **/
    Page<ProcessDefinitionsForListResp> listForPage(ProcessDefinitionsForListReq req);

    /**
     * @description 创建流程定义
     * @return cn.zwx.activiti.example.common.ResponseEntry
     * @author zhangwenxue
     * @createTime 2021/5/29 17:39
     **/
    Deployment create(MultipartFile processFile, String deploymentName);

    /**
     * @description 创建流程定义
     * @return cn.zwx.activiti.example.common.ResponseEntry
     * @author zhangwenxue
     * @createTime 2021/5/29 17:39
     **/
    void delete(DeleteDefinitionReq req);

    /**
     * @description  获取流程定义XML
     * @return java.io.InputStream
     * @author zhangwenxue
     * @createTime 2021/5/30 0:18
     **/
    InputStream getResourceAsStream(String definitionId);
   /**
    * @description  查询流程部署列表
    * @return org.activiti.api.runtime.shared.query.Page<cn.zwx.activiti.example.model.resp.ProcessDeploymentForListResp>
    * @author zhangwenxue
    * @createTime 2021/6/1 21:30
    **/
    Page<ProcessDeploymentForListResp> deploymentList(ProcessDeploymentForListReq req);
}
